The present invention relates to an decoding apparatus, a decoding method, an encoding apparatus, an encoding method, an image processing system and an image processing method, all fit for use in a system that encodes image data again. In particular, the invention relates a decoding apparatus and method for decoding a bit stream to generate image data and encoding parameters for use in encoding the image data again, to an encoding apparatus and method for encoding image data supplied from an encoding apparatus by using encoding parameters supplied therefrom, and to an image processing system and method for decoding a bit stream to generate image data, for generating encoding parameters for use in encoding the image data again and encoding image data supplied from a decoding apparatus by using encoding parameters supplied therefrom.
When a conventional system re-encodes an image signal encoded by an MPEG (Moving Picture Expert Group) system, the image signal re-encoded may be deteriorated in terms of image quality. One of the reasons for this deterioration is the discrepancy between the encoded signal and the re-encoded signal, with regard to some parameters, i.e., picture type, moving vector and the like.
An example of the deterioration of image quality, which has resulted from the change in the picture type, will be explained. Assume that there is a picture type of an input decoded image for one GOP (Group of Pictures). The GOP may consists of, for example, nine pictures (N=9)
B0, B1, I2, B3, B4, P5, B6, B7 and P8
that are based on the MPEG system. More precisely, the GOP consists of an I (Intra) picture, P (Predictive) pictures and B (Bidirectionally predictive) pictures.
Every three pictures (M=3) make one sub-group which begins with either an I picture or a P picture and which is followed by an I picture or a P picture. To lock this GOP in terms of phase, as shown below, the I picture contained in the input decoded image is used as the reference image, without being modified at all.
B0, B1, I2, B3, B4, P5, B6, B7, P8
Consider another picture type of an input decoded image for the following GOP, which is not phase-locked:
B0, I1, B2, B3, P4, B5, B6, P7
In this GOP, the third picture (B2), which is a B picture that may be greatly deteriorated in image quality, is used as the reference image in the process of encoding the image signal again. Consequently, the accuracy of re-encoding decreases, inevitably causing a great deterioration of image quality.
In the conventional encoders, not only the picture type, but also another coding parameter, e.g., the motion vector, may be maintained unchanged after the image signal is encoded again. If so, the image quality will deteriorate less than in the case where the values of the coding parameters, which have been calculated during the process of re-encoding the image signal are used. In the conventional encoders, all coding parameters, including the picture type and the motion picture, are maintained unchanged after the image is encoded again, whereby the quality of the image represented by the image signal encoded again scarcely deteriorated.
Errors may be added to the bit stream in the transmission path. The encoder that has encoded the original bit stream may use coding parameters that do not accord with the MPEG standards. In either case, the bit stream the decoder has received may have a syntax error may in some cases.
If a syntax error is made in the bit stream, the decoder searches for the next start code (a 32-bit synchronization code), from the position where the error has occurred in the bit stream, thereby accomplishing error recovery. The decoder cannot decode the signal included in a part of a bit stream that extends between the start point of the error-occurring position and the start point of the error-recovering position. Hence, the decoder uses, instead of image signals lost, the image data already decoded to conceal an error resulting from the image signal that has been lost due to the syntax error. That is, the decoder copies, for example, an image displayed in the past, and the image copied is displayed for that part of the image, which has been lost due to the syntax error.
As describe above, the conventional encoder may re-encode a decoded image signal under the condition that the coding parameter applied before the re-encoding and the coding parameter applied after the re-encoding are identical in terms of picture type or motion vector. When the decoder receives a bit stream having a syntax error, it conceals the error and outputs the concealed image data to the re-encoder. Then, the re-encoder receives no coding parameters, or receives the coding parameter having an error, from the decoder. If the encoder encodes the image signal by using the erroneous coding parameters supplied from the decoder, the image represented by the encoded image signal will have its quality greatly deteriorated.
As indicated above, hitherto the encoder encodes a bit stream, in most cases, by using the coding parameters supplied from the decoder, no matter whether a syntax error has occurred or not in the bit stream input to the decoder. The encoder cannot process the bit stream signal in a normal way, because it uses the erroneous coding parameters to encode the bit stream.
The present invention has been made in view of the foregoing. The object of the invention is to provide a decoding apparatus and method which can generate data indicating that an error has occurred in a bit stream, an encoding apparatus and method which can encode perform-n good data-encoding even if an error has occurred in a bit stream, and an image processing system and method.
A decoding apparatus according to the present invention, designed to achieve the object, comprises: decoding means for decoding an input bit stream to generate image data; parameter generating means for generating coding parameters of each layer, to be used to encode the image data again, which has been generated by the decoding means; and error flag generating means for generating an error flag which indicates whether the coding parameters generated for each layer by the parameter generating means can be effectively used to encode the image data again.
A decoding method according to the invention comprises: decoding an input bit stream to generate image data; generating coding parameters of each layer, to be used to encode the image data again; and generating an error flag which indicates whether the coding parameters generated for each layer can be effectively used to encode the image data again.
An encoding apparatus according to this invention comprises: parameter evaluating means for determining whether coding parameters for each layer, which have been input from a decoding apparatus, can be used effectively to encode image data input from the decoding apparatus, from an error flag that indicates whether the coding parameters can be used effectively; parameter calculating means for calculating coding parameters from the image data supplied from the decoding apparatus, in accordance with data supplied from the parameter evaluating means and indicating that the coding parameters are invalid; and encoding means for encoding the image data by using the coding parameters input from the decoding apparatus when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are valid, and by using the coding parameters generated by the parameter calculating means when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are invalid.
Another encoding apparatus according to the invention comprises: counting means for counting a number of times image data of a prescribed picture type is continuously input from a decoding apparatus; picture type changing means for generating coding parameters in accordance with data supplied from the counting means and indicating that the count of the counting means has reached a predetermined value, so that the image data may be encoded to image data of a different picture type; and encoding means for encoding the image data by using the coding parameters supplied from the picture type changing means.
Still another encoding method according to this invention comprises: a process of determining whether coding parameters for each layer, which have been input from a decoding apparatus, can be used effectively to encode image data input from the decoding apparatus, from an error flag that indicates whether the coding parameters can be used effectively; a process of calculating coding parameters from the image data supplied from the decoding apparatus, in accordance with data indicating that the coding parameters supplied from the decoding apparatus are invalid; and a process of encoding the image data by using the coding parameters input from the decoding apparatus when the coding parameters supplied from the decoding apparatus are determined to be valid, and by using the coding parameters generated in the process of calculating coding parameters when the coding parameters supplied from the decoding apparatus are determined to be invalid.
Another encoding method according to the present invention comprises: counting a number of times image data of a prescribed picture type is continuously input from a decoding apparatus; generating coding parameters in accordance with data supplied from the counting means and indicating that the count of the counting means has reached a predetermined value, so that the image data may be encoded to image data of a different picture type; and encoding the image data by using the coding parameters supplied from the picture type changing means.
An image processing system according to the invention comprises a decoding apparatus and an encoding apparatus. The decoding apparatus comprises: a decoding apparatus comprising: decoding means for decoding an input bit stream to generate image data; parameter generating means for generating coding parameters of each layer, to be used to encode the image data again, which has been generated by the decoding means; and error flag generating means for generating an error flag which indicates whether the coding parameters generated for each layer by the parameter generating means can be effectively used to encode the image data again. The encoding apparatus comprises: parameter evaluating means for determining whether coding parameters for each layer, which have been input from a decoding apparatus, can be used effectively to encode image data input from the decoding apparatus, from an error flag that indicates whether the coding parameters can be used effectively; parameter calculating means for calculating coding parameters from the image data supplied from the decoding apparatus, in accordance with data supplied from the parameter evaluating means and indicating that the coding parameters are invalid; and encoding means for encoding the image data by using the coding parameters input from the decoding apparatus when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are valid, and by using the coding parameters generated by the parameter calculating means when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are invalid.
Another image processing system according this invention comprises: decoding means for decoding an input bit stream to generate image data; inverse quantization means for performing inverse quantization on the image data supplied from the decoding means, thereby to generate DCT coefficients; quantization means for performing quantization on the DCT coefficients supplied from the inverse quantization means, thereby to generated image data; parameter generating means for generating coding parameters for each layer, to be used to encode the image data decoded by the decoding means; error flag generating means for generating an error flag which indicates whether the coding parameters generated for each layer by the parameter generating means can be effectively used to encode the image data again; calculating means for calculating coding parameters in accordance with the error flag supplied from the error flag generating means; encoding means for encoding the image data supplied from the quantization means, by using the coding parameters supplied from the parameter generating means or the calculating means; and control means for causing the encoding means to encode the image data by using the coding parameters generated by the parameter generating means, when the encoding parameters are determined to be valid, from the error flag generated by the error flag generating means, and by using the coding parameters generated by the calculating means, when the encoding parameters generated by the parameter generating means are determined to be invalid, from the error flag generated by the error flag generating means.
Still another image processing method according to the invention comprises: a process of decoding an input bit stream to generate image data, generating coding parameters of each layer, to be used to encode the image data again, and an error flag which indicates whether the coding parameters generated for each layer may be effectively used to encode the image data again; a process of performing inverse quantization on the image data supplied from the decoding means, thereby to generate DCT coefficients; a process of performing quantization on the DCT coefficients supplied from the inverse quantization means, thereby to generated image data; a process of calculating coding parameters in accordance with the error flag; and a process of encoding the image data by using the coding parameters generated in the process of decoding the input bit stream, when it is determined from the error flat that the encoding parameters are valid, and by using the coding parameters generated in the process of calculating coding parameters, when it is determined from the error flat that the encoding parameters are invalid.
In the decoding apparatus and the decoding method, both according to the present invention, it is possible to generate an error flag that indicates whether or not the coding parameters for each layer can be effectively used to encode image data again. The coding parameters for use in encoding the image data again can therefore be controlled after they are decoded. Hence, when the coding parameters decoded are invalid, they are not used, and the coding parameters generated by the encoder are used, thereby accurately encoding the image data again.
In the coding apparatus and the coding method, both according to the present invention, the image data is encoded by using the coding parameters input from the decoding apparatus when the coding parameters supplied from the decoding apparatus are determined to be valid, and by using the coding parameters generated by the process of calculating coding parameters when the coding parameters supplied from the decoding apparatus are invalid. Thus, when the coding parameters supplied from the decoding apparatus are valid, the input image is coded again by using the coping parameters for the image data. When the coding parameters supplied from the decoding apparatus are invalid, the coding parameters generated in the encoding apparatus or method are used to encode the image data again. Hence, the coding apparatus and method do not use the coding parameters specified by error flags, and can therefore accurately encode the image data again. As a result, the image data thus encoded again can represent a high-quality image.
In other coding apparatus and coding method according to this invention, a number of times image data of a prescribed picture type is continuously input from a decoding apparatus is counted, and the picture type of the image data is changed to another in accordance with data supplied from the counting means and indicating that the count of the counting means has reached a predetermined value. Therefore, the image data can be encoded to image data of a different picture type. The coding parameters generated to change the picture type are used, thereby encoding the image data. Thus, it is possible to change the coding parameters to encode the image data again, even if the coding parameters input from the decoding apparatus are ones that cannot be encoded in the encoding apparatus. Hence, the image data thus encoded again can represent a high-quality image.
An image processing system according to the invention comprises a decoding apparatus and an encoding apparatus. The decoding apparatus comprises error flag generating means for generating an error flag which indicates whether the coding parameters generated for each layer by the parameter generating means can be effectively used to encode the image data again. The encoding apparatus comprises: parameter evaluating means for determining whether coding parameters for each layer, which have been input from a decoding apparatus, can be used effectively to encode image data input from the decoding apparatus, from an error flag that indicates whether the coding parameters can be used effectively; parameter calculating means for calculating coding parameters from the image data supplied from the decoding apparatus, in accordance with data supplied from the parameter evaluating means and indicating that the coding parameters are invalid; and encoding means for encoding the image data by using the coding parameters input from the decoding apparatus when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are valid, and by using the coding parameters generated by the parameter calculating means when the parameter-evaluating mean determines that the coding parameters supplied from the decoding apparatus are invalid. Therefore, the encoding apparatus encodes the image data again by using the coding parameters input from the decoding apparatus when the coding parameters supplied from the decoding apparatus are valid, and by using the coding parameters generated by the parameter calculating means when the coding parameters supplied from the decoding apparatus are invalid. Hence, the coding apparatus and method do not use the coding parameters specified by error flags, and can therefore accurately encode the image data again. The image data thus encoded again can therefore represent a high-quality image.
Another image processing system and another image processing method, according to the present invention, performs a decoding process, in which an input bit stream is decoded into image data and an error flag is generated, which indicates whether the coding parameters generated for each layer may be effectively used to encode the image data again. The system and method further perform an encoding process, in which coding parameters are calculated in accordance with the error flag, the image data is encoded by using the coding parameters generated in the process of decoding the input bit stream, when it is determined from the error flat that the encoding parameters are valid, and by using the coding parameters generated in the process of calculating coding parameters, when it is determined from the error flat that the encoding parameters are invalid. Thus, the image data again is encoded again by using the coding parameters input from the decoding apparatus when the coding parameters supplied from the decoding apparatus are valid, and by using the coding parameters generated by the parameter calculating means when the coding parameters supplied from the decoding apparatus are invalid. Hence, the image processing system and the image processing method do not use the coding parameters specified by error flags, and can therefore accurately encode the image data again. The image data thus encoded again can therefore represent a high-quality image.